package co.yixiang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author zf
 * 禁用状态相关枚举
 */
@Getter
@AllArgsConstructor
public enum DisableEnum {

	/**
	 * 有效
	 */
	VALID("0","有效"),

	/**
	 * 禁用
	 */
	DISABLE("1","禁用");


	private String value;
	private String desc;

	public static DisableEnum toType(String value) {
		return Stream.of(DisableEnum.values())
				.filter(p -> p.value.equals(value))
				.findAny()
				.orElse(null);
	}

	public String value() {
		return value;
	}
}
